package com.googlecode.ssdutils.certificatmanager.cli;

import java.io.IOException;
import java.security.GeneralSecurityException;

import com.googlecode.ssdutils.jlauncher.annotations.Launcher;
import com.googlecode.ssdutils.jlauncher.annotations.Option;

import fr.ssd.ci.certificat.Installer;

public class CertificatInstaller {

	@Option(name = "host", help = "Host name of the service.")
	private String host;

	@Option(name = "port", help = "Port of the service.", optional = true)
	private int port;

	@Option(name = "password", help = "Trustore password.", optional = true)
	private String password;

	@Launcher
	public void main() throws GeneralSecurityException, IOException {
		if (password == null || password.equals(""))
			password = "changeit"; // maven compatibility

		new Installer().installCertificat(host, port, password);
	}

}